<template>
  <div>
    <p class="pinformation" style="margin-top: 10px">精密度与准确度</p>
    <screenshotView
      :fileList="form.accuracyFileList"
      :height="21"
    ></screenshotView>
  </div>
</template>

<script setup>
import screenshotView from "../screenshotView/screenshotView";

import { getmethodAccuracy } from "@/api/store/method";

const form = ref({ accuracyFileList: [] });

const methodId = ref("");

const props = defineProps({
  methodId: {
    type: String, //参数类型
    required: true, //是否必须传递
  },
});

watch(
  () => props.methodId,
  () => {
    if (!props.methodId) return;
    methodId.value = props.methodId;
    getList();
  },
  { deep: true, immediate: true }
);

function getList() {
  getmethodAccuracy(methodId.value).then((response) => {
    form.value.accuracyFileList = [];
    response.data.accuracyFileList.forEach((item) => {
      if (!item.fileList[0]) return;
      form.value.accuracyFileList.push(item.fileList[0]);
    });
  });
}
</script>
